import Vue from 'vue'
import Vuex from 'vuex'
import { isWeiXin } from '@utils'
import persistedState from 'vuex-persistedstate'

Vue.use(Vuex)

export default new Vuex.Store({
  plugins: [persistedState()],
  state: {
    footerActive: 0, 
    inWeixin: isWeiXin(),    // 微信环境
  },
  mutations: {
    setFooterActive(state, data) {
      state.footerActive = data
    },
  },
  getters: {
    footerActive: state => state.footerActive,
    inWeixin: state => state.inWeixin,
  }
})
